<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Type Aliases  Reference</title>
    <link rel="stylesheet" type="text/css" href="css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="css/highlight.css" />
    <meta charset="utf-8">
    <script src="js/jquery.min.js" defer></script>
    <script src="js/jazzy.js" defer></script>
    
    <script src="js/lunr.min.js" defer></script>
    <script src="js/typeahead.jquery.js" defer></script>
    <script src="js/jazzy.search.js" defer></script>
  </head>
  <body>

    <a name="//apple_ref/swift/Section/Type Aliases" class="dashAnchor"></a>

    <a title="Type Aliases  Reference"></a>

    <header class="header">
      <p class="header-col header-col--primary">
        <a class="header-link" href="index.html">
          KituraContracts 1.2.200 Docs
        </a>
         (99% documented)
      </p>
    
      <p class="header-col--secondary">
        <form role="search" action="search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>
      </p>
    
        <p class="header-col header-col--secondary">
          <a class="header-link" href="https://github.com/Kitura/KituraContracts/">
            <img class="header-icon" src="img/gh.png"/>
            View on GitHub
          </a>
        </p>
    
    </header>

    <p class="breadcrumbs">
      <a class="breadcrumb" href="index.html">KituraContracts Reference</a>
      <img class="carat" src="img/carat.png" />
      Type Aliases  Reference
    </p>

    <div class="content-wrapper">
      <nav class="navigation">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/Coder.html">Coder</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/QueryDecoder.html">QueryDecoder</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/QueryEncoder.html">QueryEncoder</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Enums.html">Enumerations</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/IdentifierError.html">IdentifierError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/Operator.html">Operator</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/Order.html">Order</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/QueryParamsError.html">QueryParamsError</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Bool.html">Bool</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Double.html">Double</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Float.html">Float</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Int.html">Int</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Int16.html">Int16</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Int32.html">Int32</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Int64.html">Int64</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Int8.html">Int8</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions.html#/s:10Foundation11JSONDecoderC">JSONDecoder</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions.html#/s:10Foundation11JSONEncoderC">JSONEncoder</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/String.html">String</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/UInt.html">UInt</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/UInt16.html">UInt16</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/UInt32.html">UInt32</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/UInt64.html">UInt64</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/UInt8.html">UInt8</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/UUID.html">UUID</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/BodyDecoder.html">BodyDecoder</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/BodyEncoder.html">BodyEncoder</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/Identifier.html">Identifier</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/Operation.html">Operation</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/QueryParams.html">QueryParams</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/BodyFormat.html">BodyFormat</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/ExclusiveRange.html">ExclusiveRange</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/GreaterThan.html">GreaterThan</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/GreaterThanOrEqual.html">GreaterThanOrEqual</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/InclusiveRange.html">InclusiveRange</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/LowerThan.html">LowerThan</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/LowerThanOrEqual.html">LowerThanOrEqual</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/Ordering.html">Ordering</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/Pagination.html">Pagination</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/RequestError.html">RequestError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/RequestError/ErrorBody.html">– ErrorBody</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/UnsupportedBodyFormatError.html">UnsupportedBodyFormatError</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Typealiases.html">Type Aliases</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Typealiases.html#/s:15KituraContracts19CodableArrayClosurea">CodableArrayClosure</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Typealiases.html#/s:15KituraContracts25CodableArrayResultClosurea">CodableArrayResultClosure</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Typealiases.html#/s:15KituraContracts14CodableClosurea">CodableClosure</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Typealiases.html#/s:15KituraContracts24CodableIdentifierClosurea">CodableIdentifierClosure</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Typealiases.html#/s:15KituraContracts20CodableResultClosurea">CodableResultClosure</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Typealiases.html#/s:15KituraContracts29IdentifierCodableArrayClosurea">IdentifierCodableArrayClosure</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Typealiases.html#/s:15KituraContracts35IdentifierCodableArrayResultClosurea">IdentifierCodableArrayResultClosure</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Typealiases.html#/s:15KituraContracts24IdentifierCodableClosurea">IdentifierCodableClosure</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Typealiases.html#/s:15KituraContracts30IdentifierCodableResultClosurea">IdentifierCodableResultClosure</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Typealiases.html#/s:15KituraContracts27IdentifierNonCodableClosurea">IdentifierNonCodableClosure</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Typealiases.html#/s:15KituraContracts30IdentifierSimpleCodableClosurea">IdentifierSimpleCodableClosure</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Typealiases.html#/s:15KituraContracts17NonCodableClosurea">NonCodableClosure</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Typealiases.html#/s:15KituraContracts13ResultClosurea">ResultClosure</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Typealiases.html#/s:15KituraContracts20SimpleCodableClosurea">SimpleCodableClosure</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">

        <section class="section">
          <div class="section-content top-matter">
            <h1>Type Aliases</h1>
            <p>The following type aliases are available globally.</p>

          </div>
        </section>

        <section class="section">
          <div class="section-content">
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Codable%20Type%20Aliases"></a>
                <a name="//apple_ref/swift/Section/Codable Type Aliases" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Codable%20Type%20Aliases"></a>
                  <h3 class="section-name"><p>Codable Type Aliases</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15KituraContracts13ResultClosurea"></a>
                    <a name="//apple_ref/swift/Alias/ResultClosure" class="dashAnchor"></a>
                    <a class="token" href="#/s:15KituraContracts13ResultClosurea">ResultClosure</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The <code>ResultClosure</code> is used by other <code>Codable</code> aliases when responding with only a <code><a href="Structs/RequestError.html">RequestError</a></code> is needed.</p>

<p>The following two typealiases make use of <code>ResultClosure</code>:</p>
<pre class="highlight swift"><code> <span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">NonCodableClosure</span> <span class="o">=</span> <span class="p">(</span><span class="kd">@escaping</span> <span class="kt">ResultClosure</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span>

 <span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">IdentifierNonCodableClosure</span><span class="o">&lt;</span><span class="kt">Id</span><span class="p">:</span> <span class="kt">Identifier</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kt">Id</span><span class="p">,</span> <span class="kd">@escaping</span> <span class="kt">ResultClosure</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">ResultClosure</span> <span class="o">=</span> <span class="p">(</span><span class="kt"><a href="Structs/RequestError.html">RequestError</a></span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15KituraContracts20CodableResultClosurea"></a>
                    <a name="//apple_ref/swift/Alias/CodableResultClosure" class="dashAnchor"></a>
                    <a class="token" href="#/s:15KituraContracts20CodableResultClosurea">CodableResultClosure</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The <code>CodableResultClosure</code> is used by other <code>Codable</code> aliases when responding with an object which conforms to <code>Codable</code>, or a <code><a href="Structs/RequestError.html">RequestError</a></code> is needed.</p>

<p>The following two typealiases make use of <code>CodableResultClosure</code>:</p>
<pre class="highlight swift"><code> <span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">IdentifierCodableClosure</span><span class="o">&lt;</span><span class="kt">Id</span><span class="p">:</span> <span class="kt">Identifier</span><span class="p">,</span> <span class="kt">I</span><span class="p">:</span> <span class="kt">Codable</span><span class="p">,</span> <span class="kt">O</span><span class="p">:</span> <span class="kt">Codable</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kt">Id</span><span class="p">,</span> <span class="kt">I</span><span class="p">,</span> <span class="kd">@escaping</span> <span class="kt">CodableResultClosure</span><span class="o">&lt;</span><span class="kt">O</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span>

 <span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">CodableClosure</span><span class="o">&lt;</span><span class="kt">I</span><span class="p">:</span> <span class="kt">Codable</span><span class="p">,</span> <span class="kt">O</span><span class="p">:</span> <span class="kt">Codable</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kt">I</span><span class="p">,</span> <span class="kd">@escaping</span> <span class="kt">CodableResultClosure</span><span class="o">&lt;</span><span class="kt">O</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">CodableResultClosure</span><span class="o">&lt;</span><span class="kt">O</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kt">O</span><span class="p">?,</span> <span class="kt"><a href="Structs/RequestError.html">RequestError</a></span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">where</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15KituraContracts25CodableArrayResultClosurea"></a>
                    <a name="//apple_ref/swift/Alias/CodableArrayResultClosure" class="dashAnchor"></a>
                    <a class="token" href="#/s:15KituraContracts25CodableArrayResultClosurea">CodableArrayResultClosure</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The <code>CodableArrayResultClosure</code> is used by other <code>Codable</code> aliases when responding with an array of objects which conform to <code>Codable</code>, or a <code><a href="Structs/RequestError.html">RequestError</a></code> is needed.</p>

<p>The following typealias makes use of <code>CodableArrayResultClosure</code>:</p>
<pre class="highlight swift"><code> <span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">CodableArrayClosure</span><span class="o">&lt;</span><span class="kt">O</span><span class="p">:</span> <span class="kt">Codable</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kd">@escaping</span> <span class="kt">CodableArrayResultClosure</span><span class="o">&lt;</span><span class="kt">O</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">CodableArrayResultClosure</span><span class="o">&lt;</span><span class="kt">O</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">([</span><span class="kt">O</span><span class="p">]?,</span> <span class="kt"><a href="Structs/RequestError.html">RequestError</a></span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">where</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15KituraContracts35IdentifierCodableArrayResultClosurea"></a>
                    <a name="//apple_ref/swift/Alias/IdentifierCodableArrayResultClosure" class="dashAnchor"></a>
                    <a class="token" href="#/s:15KituraContracts35IdentifierCodableArrayResultClosurea">IdentifierCodableArrayResultClosure</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The <code>IdentifierCodableArrayResultClosure</code> is used by other <code>Codable</code> aliases when responding with an array of tuples containing an identifier and a <code>Codable</code> object, or a <code><a href="Structs/RequestError.html">RequestError</a></code>.</p>

<p>The following typealias makes use of <code>IdentifierCodableArrayResultClosure</code>:</p>
<pre class="highlight swift"><code> <span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">CodableIdentifierClosure</span><span class="o">&lt;</span><span class="kt">I</span><span class="p">:</span> <span class="kt">Codable</span><span class="p">,</span> <span class="kt">Id</span><span class="p">:</span> <span class="kt">Identifier</span><span class="p">,</span> <span class="kt">O</span><span class="p">:</span> <span class="kt">Codable</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kt">I</span><span class="p">,</span> <span class="kd">@escaping</span> <span class="kt">IdentifierCodableResultClosure</span><span class="o">&lt;</span><span class="p">[</span><span class="kt">Id</span><span class="p">,</span> <span class="kt">O</span><span class="p">]?</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">IdentifierCodableArrayResultClosure</span><span class="o">&lt;</span><span class="kt">Id</span><span class="p">,</span> <span class="kt">O</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">([(</span><span class="kt">Id</span><span class="p">,</span> <span class="kt">O</span><span class="p">)]?,</span> <span class="kt"><a href="Structs/RequestError.html">RequestError</a></span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">where</span> <span class="kt">Id</span> <span class="p">:</span> <span class="kt"><a href="Protocols/Identifier.html">Identifier</a></span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15KituraContracts30IdentifierCodableResultClosurea"></a>
                    <a name="//apple_ref/swift/Alias/IdentifierCodableResultClosure" class="dashAnchor"></a>
                    <a class="token" href="#/s:15KituraContracts30IdentifierCodableResultClosurea">IdentifierCodableResultClosure</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>This is used to perform a series of actions which use an object conforming to <code><a href="Protocols/Identifier.html">Identifier</a></code> and an object conforming to <code>Codable</code>. After which you want to respond with an object which conforms to <code>Codable</code>, which is of the same type as the object passed as a parameter, or respond with an <code><a href="Protocols/Identifier.html">Identifier</a></code> or <code><a href="Structs/RequestError.html">RequestError</a></code>.</p>

<p>The following typealias makes use of <code>IdentifierCodableResultClosure</code>:</p>
<pre class="highlight swift"><code> <span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">CodableIdentifierClosure</span><span class="o">&lt;</span><span class="kt">I</span><span class="p">:</span> <span class="kt">Codable</span><span class="p">,</span> <span class="kt">Id</span><span class="p">:</span> <span class="kt">Identifier</span><span class="p">,</span> <span class="kt">O</span><span class="p">:</span> <span class="kt">Codable</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kt">I</span><span class="p">,</span> <span class="kd">@escaping</span> <span class="kt">IdentifierCodableResultClosure</span><span class="o">&lt;</span><span class="kt">Id</span><span class="p">,</span> <span class="kt">O</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">IdentifierCodableResultClosure</span><span class="o">&lt;</span><span class="kt">Id</span><span class="p">,</span> <span class="kt">O</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kt">Id</span><span class="p">?,</span> <span class="kt">O</span><span class="p">?,</span> <span class="kt"><a href="Structs/RequestError.html">RequestError</a></span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">where</span> <span class="kt">Id</span> <span class="p">:</span> <span class="kt"><a href="Protocols/Identifier.html">Identifier</a></span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15KituraContracts24IdentifierCodableClosurea"></a>
                    <a name="//apple_ref/swift/Alias/IdentifierCodableClosure" class="dashAnchor"></a>
                    <a class="token" href="#/s:15KituraContracts24IdentifierCodableClosurea">IdentifierCodableClosure</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The <code>IdentifierCodableClosure</code> is used to perform a series of actions utilising an object conforming to <code><a href="Protocols/Identifier.html">Identifier</a></code> and an object conforming to &lsquo;Codable&rsquo;, then respond with an object which conforms to <code>Codable</code>, which is of the same type as the object passed as a parameter, or responding with a <code><a href="Structs/RequestError.html">RequestError</a></code> in the form of a <code><a href="Typealiases.html#/s:15KituraContracts20CodableResultClosurea">CodableResultClosure</a></code>.</p>

<p>By default <code>Int</code> has conformity to <code><a href="Protocols/Identifier.html">Identifier</a></code>. In this example, if there has been an error you can use the <code>respondWith</code> call to respond with an appropriate error, passing nil for the <code>User?</code>. If no errors occurred and you have a <code>User</code>, you can just respond with the user, passing nil as the <code>RequestError?</code> value.</p>
<h3 id='usage-example' class='heading'>Usage Example:</h3>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">User</span><span class="p">:</span> <span class="kt">Codable</span> <span class="p">{</span>
  <span class="o">...</span>
<span class="p">}</span>

<span class="k">var</span> <span class="nv">userStore</span><span class="p">:</span> <span class="p">[</span><span class="kt">Int</span><span class="p">,</span> <span class="kt">User</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="o">...</span><span class="p">]</span>

<span class="n">router</span><span class="o">.</span><span class="nf">put</span><span class="p">(</span><span class="s">"/users"</span><span class="p">)</span> <span class="p">{</span> <span class="p">(</span><span class="nv">id</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">user</span><span class="p">:</span> <span class="kt">User</span><span class="p">,</span> <span class="nv">respondWith</span><span class="p">:</span> <span class="p">(</span><span class="kt">User</span><span class="p">?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="k">in</span>
  <span class="k">guard</span> <span class="k">let</span> <span class="nv">oldUser</span> <span class="o">=</span> <span class="k">self</span><span class="o">.</span><span class="n">userStore</span><span class="p">[</span><span class="n">id</span><span class="p">]</span> <span class="k">else</span> <span class="p">{</span>
      <span class="nf">respondWith</span><span class="p">(</span><span class="kc">nil</span><span class="p">,</span> <span class="o">.</span><span class="n">notFound</span><span class="p">)</span>
      <span class="k">return</span>
  <span class="p">}</span>

  <span class="o">...</span>

  <span class="nf">respondWith</span><span class="p">(</span><span class="n">user</span><span class="p">,</span> <span class="kc">nil</span><span class="p">)</span>
<span class="p">}</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">IdentifierCodableClosure</span><span class="o">&lt;</span><span class="kt">Id</span><span class="p">,</span> <span class="kt">I</span><span class="p">,</span> <span class="kt">O</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kt">Id</span><span class="p">,</span> <span class="kt">I</span><span class="p">,</span> <span class="kd">@escaping</span> <span class="kt"><a href="Typealiases.html#/s:15KituraContracts20CodableResultClosurea">CodableResultClosure</a></span><span class="o">&lt;</span><span class="kt">O</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">where</span> <span class="kt">Id</span> <span class="p">:</span> <span class="kt"><a href="Protocols/Identifier.html">Identifier</a></span><span class="p">,</span> <span class="kt">I</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">I</span> <span class="p">:</span> <span class="kt">Encodable</span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15KituraContracts14CodableClosurea"></a>
                    <a name="//apple_ref/swift/Alias/CodableClosure" class="dashAnchor"></a>
                    <a class="token" href="#/s:15KituraContracts14CodableClosurea">CodableClosure</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The <code>CodableClosure</code> is used to perform a series of actions utilising an object conforming to <code><a href="Protocols/Identifier.html">Identifier</a></code>, then respond with an object which conforms to <code>Codable</code>, which is of the same type as the object passed as a parameter, or responding with a <code><a href="Structs/RequestError.html">RequestError</a></code> in the form of a <code><a href="Typealiases.html#/s:15KituraContracts20CodableResultClosurea">CodableResultClosure</a></code>.</p>

<p>If no errors occurred and you have a <code>User</code>, you can just respond with the user by passing nil as the <code>RequestError?</code> value. In this example, if there has been an error you can use the <code>respondWith</code> call to respond with an appropriate error and passing nil for the <code>User?</code>.</p>
<h3 id='usage-example' class='heading'>Usage Example:</h3>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">User</span><span class="p">:</span> <span class="kt">Codable</span> <span class="p">{</span>
  <span class="o">...</span>
<span class="p">}</span>

<span class="n">router</span><span class="o">.</span><span class="nf">post</span><span class="p">(</span><span class="s">"/users"</span><span class="p">)</span> <span class="p">{</span> <span class="p">(</span><span class="nv">user</span><span class="p">:</span> <span class="kt">User</span><span class="p">,</span> <span class="nv">respondWith</span><span class="p">:</span> <span class="p">(</span><span class="kt">User</span><span class="p">?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="k">in</span>
  <span class="k">if</span> <span class="n">databaseConnectionIsOk</span> <span class="p">{</span>
      <span class="o">...</span>
      <span class="nf">respondWith</span><span class="p">(</span><span class="n">user</span><span class="p">,</span> <span class="kc">nil</span><span class="p">)</span>
  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
      <span class="o">...</span>
      <span class="nf">respondWith</span><span class="p">(</span><span class="kc">nil</span><span class="p">,</span> <span class="o">.</span><span class="n">internalServerError</span><span class="p">)</span>
  <span class="p">}</span>
<span class="p">}</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">CodableClosure</span><span class="o">&lt;</span><span class="kt">I</span><span class="p">,</span> <span class="kt">O</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kt">I</span><span class="p">,</span> <span class="kd">@escaping</span> <span class="kt"><a href="Typealiases.html#/s:15KituraContracts20CodableResultClosurea">CodableResultClosure</a></span><span class="o">&lt;</span><span class="kt">O</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">where</span> <span class="kt">I</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">I</span> <span class="p">:</span> <span class="kt">Encodable</span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15KituraContracts24CodableIdentifierClosurea"></a>
                    <a name="//apple_ref/swift/Alias/CodableIdentifierClosure" class="dashAnchor"></a>
                    <a class="token" href="#/s:15KituraContracts24CodableIdentifierClosurea">CodableIdentifierClosure</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The <code>CodableIdentifierClosure</code> is used to perform a series of actions utilising an object conforming to <code><a href="Protocols/Identifier.html">Identifier</a></code>, then respond with an object which conforms to <code>Codable</code>, and/or an object conforming to <code><a href="Protocols/Identifier.html">Identifier</a></code> or responding with a <code><a href="Structs/RequestError.html">RequestError</a></code> in the form of a <code><a href="Typealiases.html#/s:15KituraContracts30IdentifierCodableResultClosurea">IdentifierCodableResultClosure</a></code>.</p>

<p>If no errors occurred and you have a <code>User</code> and the corresponding identifier, you can just respond with the identifier and user, and pass nil as the <code>RequestError?</code> value. In this example, if there has been an error you can use the <code>respondWith</code> call to respond with an appropriate error and passing nil for <code>Int?</code> and nil for <code>User?</code>.</p>
<h3 id='usage-example' class='heading'>Usage Example:</h3>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">User</span><span class="p">:</span> <span class="kt">Codable</span> <span class="p">{</span>
  <span class="o">...</span>
<span class="p">}</span>

<span class="n">router</span><span class="o">.</span><span class="nf">post</span><span class="p">(</span><span class="s">"/users"</span><span class="p">)</span> <span class="p">{</span> <span class="p">(</span><span class="nv">user</span><span class="p">:</span> <span class="kt">User</span><span class="p">,</span> <span class="nv">respondWith</span><span class="p">:</span> <span class="p">(</span><span class="kt">Int</span><span class="p">?,</span> <span class="kt">User</span><span class="p">?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="k">in</span>
  <span class="k">if</span> <span class="n">databaseConnectionIsOk</span> <span class="p">{</span>
      <span class="o">...</span>
      <span class="nf">respondWith</span><span class="p">(</span><span class="n">id</span><span class="p">,</span> <span class="n">user</span><span class="p">,</span> <span class="kc">nil</span><span class="p">)</span>
  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
      <span class="o">...</span>
      <span class="nf">respondWith</span><span class="p">(</span><span class="kc">nil</span><span class="p">,</span> <span class="kc">nil</span><span class="p">,</span> <span class="o">.</span><span class="n">internalServerError</span><span class="p">)</span>
  <span class="p">}</span>
<span class="p">}</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">CodableIdentifierClosure</span><span class="o">&lt;</span><span class="kt">I</span><span class="p">,</span> <span class="kt">Id</span><span class="p">,</span> <span class="kt">O</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kt">I</span><span class="p">,</span> <span class="kd">@escaping</span> <span class="kt"><a href="Typealiases.html#/s:15KituraContracts30IdentifierCodableResultClosurea">IdentifierCodableResultClosure</a></span><span class="o">&lt;</span><span class="kt">Id</span><span class="p">,</span> <span class="kt">O</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">where</span> <span class="kt">I</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">I</span> <span class="p">:</span> <span class="kt">Encodable</span><span class="p">,</span> <span class="kt">Id</span> <span class="p">:</span> <span class="kt"><a href="Protocols/Identifier.html">Identifier</a></span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15KituraContracts17NonCodableClosurea"></a>
                    <a name="//apple_ref/swift/Alias/NonCodableClosure" class="dashAnchor"></a>
                    <a class="token" href="#/s:15KituraContracts17NonCodableClosurea">NonCodableClosure</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The <code>NonCodableClosure</code> is used to perform a series of actions then respond with a <code><a href="Structs/RequestError.html">RequestError</a></code> in the form of a <code><a href="Typealiases.html#/s:15KituraContracts13ResultClosurea">ResultClosure</a></code>.</p>

<p>If no errors occurred you can just pass nil as the <code>RequestError?</code> value. In this example, if there has been an error you can use the <code>respondWith</code> call to respond with an appropriate error.</p>
<h3 id='usage-example' class='heading'>Usage Example:</h3>
<pre class="highlight swift"><code><span class="n">router</span><span class="o">.</span><span class="nf">delete</span><span class="p">(</span><span class="s">"/users"</span><span class="p">)</span> <span class="p">{</span> <span class="p">(</span><span class="nv">respondWith</span><span class="p">:</span> <span class="p">(</span><span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="k">in</span>
    <span class="k">if</span> <span class="n">databaseConnectionIsOk</span> <span class="p">{</span>
      <span class="o">...</span>
      <span class="nf">respondWith</span><span class="p">(</span><span class="kc">nil</span><span class="p">)</span>
    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
      <span class="nf">respondWith</span><span class="p">(</span><span class="o">.</span><span class="n">internalServerError</span><span class="p">)</span>
      <span class="o">...</span>
    <span class="p">}</span>
<span class="p">}</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">NonCodableClosure</span> <span class="o">=</span> <span class="p">(</span><span class="kd">@escaping</span> <span class="kt"><a href="Typealiases.html#/s:15KituraContracts13ResultClosurea">ResultClosure</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15KituraContracts27IdentifierNonCodableClosurea"></a>
                    <a name="//apple_ref/swift/Alias/IdentifierNonCodableClosure" class="dashAnchor"></a>
                    <a class="token" href="#/s:15KituraContracts27IdentifierNonCodableClosurea">IdentifierNonCodableClosure</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The <code>IdentifierNonCodableClosure</code> is used to perform a series of actions utilising an object which conforms to <code><a href="Protocols/Identifier.html">Identifier</a></code>, then respond with a <code><a href="Structs/RequestError.html">RequestError</a></code> in the form of a <code><a href="Typealiases.html#/s:15KituraContracts13ResultClosurea">ResultClosure</a></code>.</p>

<p>If no errors occurred you can just pass nil as the <code>RequestError?</code> value. In this example, if there has been an error you can use the <code>respondWith</code> call to respond with an appropriate error.</p>
<h3 id='usage-example' class='heading'>Usage Example:</h3>
<pre class="highlight swift"><code><span class="n">router</span><span class="o">.</span><span class="nf">delete</span><span class="p">(</span><span class="s">"/users"</span><span class="p">)</span> <span class="p">{</span> <span class="p">(</span><span class="nv">id</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">respondWith</span><span class="p">:</span> <span class="p">(</span><span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="k">in</span>
  <span class="k">if</span> <span class="n">databaseConnectionIsOk</span> <span class="p">{</span>
      <span class="o">...</span>
      <span class="nf">respondWith</span><span class="p">(</span><span class="kc">nil</span><span class="p">)</span>
  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
      <span class="o">...</span>
      <span class="nf">respondWith</span><span class="p">(</span><span class="o">.</span><span class="n">internalServerError</span><span class="p">)</span>
  <span class="p">}</span>
<span class="p">}</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">IdentifierNonCodableClosure</span><span class="o">&lt;</span><span class="kt">Id</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kt">Id</span><span class="p">,</span> <span class="kd">@escaping</span> <span class="kt"><a href="Typealiases.html#/s:15KituraContracts13ResultClosurea">ResultClosure</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">where</span> <span class="kt">Id</span> <span class="p">:</span> <span class="kt"><a href="Protocols/Identifier.html">Identifier</a></span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15KituraContracts19CodableArrayClosurea"></a>
                    <a name="//apple_ref/swift/Alias/CodableArrayClosure" class="dashAnchor"></a>
                    <a class="token" href="#/s:15KituraContracts19CodableArrayClosurea">CodableArrayClosure</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The <code>CodableArrayClosure</code> is used to perform a series of actions then respond with an array of objects conforming to <code>Codable</code> or a <code><a href="Structs/RequestError.html">RequestError</a></code> in the form of a <code><a href="Typealiases.html#/s:15KituraContracts25CodableArrayResultClosurea">CodableArrayResultClosure</a></code>.</p>

<p>If no errors occurred and you have an array of <code>Users</code> you can just respond with the users by passing nil as the <code>RequestError?</code> value. In this example, if there has been an error you can use the <code>respondWith</code> call to respond with an appropriate error and passing nil for the <code>[User]?</code>.</p>
<h3 id='usage-example' class='heading'>Usage Example:</h3>
<pre class="highlight swift"><code><span class="n">router</span><span class="o">.</span><span class="nf">get</span><span class="p">(</span><span class="s">"/users"</span><span class="p">)</span> <span class="p">{</span> <span class="p">(</span><span class="nv">respondWith</span><span class="p">:</span> <span class="p">([</span><span class="kt">User</span><span class="p">]?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="k">in</span>
  <span class="k">if</span> <span class="n">databaseConnectionIsOk</span> <span class="p">{</span>
      <span class="o">...</span>
      <span class="nf">respondWith</span><span class="p">(</span><span class="n">users</span><span class="p">,</span> <span class="kc">nil</span><span class="p">)</span>
  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
      <span class="o">...</span>
      <span class="nf">respondWith</span><span class="p">(</span><span class="kc">nil</span><span class="p">,</span> <span class="o">.</span><span class="n">internalServerError</span><span class="p">)</span>
  <span class="p">}</span>
<span class="p">}</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">CodableArrayClosure</span><span class="o">&lt;</span><span class="kt">O</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kd">@escaping</span> <span class="kt"><a href="Typealiases.html#/s:15KituraContracts25CodableArrayResultClosurea">CodableArrayResultClosure</a></span><span class="o">&lt;</span><span class="kt">O</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">where</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15KituraContracts29IdentifierCodableArrayClosurea"></a>
                    <a name="//apple_ref/swift/Alias/IdentifierCodableArrayClosure" class="dashAnchor"></a>
                    <a class="token" href="#/s:15KituraContracts29IdentifierCodableArrayClosurea">IdentifierCodableArrayClosure</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The <code>IdentifierCodableArrayClosure</code> is used to perform a series of actions then respond with an array of tuples containing an identifier and a Codable object, or a <code><a href="Structs/RequestError.html">RequestError</a></code>, in the form of a <code><a href="Typealiases.html#/s:15KituraContracts35IdentifierCodableArrayResultClosurea">IdentifierCodableArrayResultClosure</a></code>.</p>

<p>If no errors occurred and you have an array of <code>Users</code> you can just respond with the users by passing nil as the <code>RequestError?</code> value. In this example, if there has been an error you can use the <code>respondWith</code> call to respond with an appropriate error and passing nil for the <code>[User]?</code>.</p>
<h3 id='usage-example' class='heading'>Usage Example:</h3>
<pre class="highlight swift"><code><span class="n">router</span><span class="o">.</span><span class="nf">get</span><span class="p">(</span><span class="s">"/users"</span><span class="p">)</span> <span class="p">{</span> <span class="p">(</span><span class="nv">respondWith</span><span class="p">:</span> <span class="p">([(</span><span class="kt">Int</span><span class="p">,</span> <span class="kt">User</span><span class="p">)]?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="k">in</span>
   <span class="k">if</span> <span class="n">databaseConnectionIsOk</span> <span class="p">{</span>
       <span class="o">...</span>
       <span class="nf">respondWith</span><span class="p">([(</span><span class="kt">Int</span><span class="p">,</span> <span class="kt">User</span><span class="p">)],</span> <span class="kc">nil</span><span class="p">)</span>
   <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
       <span class="o">...</span>
       <span class="nf">respondWith</span><span class="p">(</span><span class="kc">nil</span><span class="p">,</span> <span class="o">.</span><span class="n">internalServerError</span><span class="p">)</span>
   <span class="p">}</span>
<span class="p">}</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">IdentifierCodableArrayClosure</span><span class="o">&lt;</span><span class="kt">Id</span><span class="p">,</span> <span class="kt">O</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kd">@escaping</span> <span class="kt"><a href="Typealiases.html#/s:15KituraContracts35IdentifierCodableArrayResultClosurea">IdentifierCodableArrayResultClosure</a></span><span class="o">&lt;</span><span class="kt">Id</span><span class="p">,</span> <span class="kt">O</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">where</span> <span class="kt">Id</span> <span class="p">:</span> <span class="kt"><a href="Protocols/Identifier.html">Identifier</a></span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15KituraContracts20SimpleCodableClosurea"></a>
                    <a name="//apple_ref/swift/Alias/SimpleCodableClosure" class="dashAnchor"></a>
                    <a class="token" href="#/s:15KituraContracts20SimpleCodableClosurea">SimpleCodableClosure</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The <code>SimpleCodableClosure</code> is used to perform a series of actions, then respond with an object conforming to <code>Codable</code> or a <code><a href="Structs/RequestError.html">RequestError</a></code> in the form of a <code><a href="Typealiases.html#/s:15KituraContracts20CodableResultClosurea">CodableResultClosure</a></code>.</p>
<h3 id='usage-example' class='heading'>Usage Example:</h3>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Status</span><span class="p">:</span> <span class="kt">Codable</span> <span class="p">{</span>
  <span class="o">...</span>
<span class="p">}</span>

<span class="n">router</span><span class="o">.</span><span class="nf">get</span><span class="p">(</span><span class="s">"/status"</span><span class="p">)</span> <span class="p">{</span> <span class="p">(</span><span class="nv">respondWith</span><span class="p">:</span> <span class="p">(</span><span class="kt">Status</span><span class="p">?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="k">in</span>
  <span class="o">...</span>
  <span class="nf">respondWith</span><span class="p">(</span><span class="n">status</span><span class="p">,</span> <span class="kc">nil</span><span class="p">)</span>
<span class="p">}</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">SimpleCodableClosure</span><span class="o">&lt;</span><span class="kt">O</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kd">@escaping</span> <span class="kt"><a href="Typealiases.html#/s:15KituraContracts20CodableResultClosurea">CodableResultClosure</a></span><span class="o">&lt;</span><span class="kt">O</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">where</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15KituraContracts30IdentifierSimpleCodableClosurea"></a>
                    <a name="//apple_ref/swift/Alias/IdentifierSimpleCodableClosure" class="dashAnchor"></a>
                    <a class="token" href="#/s:15KituraContracts30IdentifierSimpleCodableClosurea">IdentifierSimpleCodableClosure</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The <code>IdentifierSimpleCodableClosure</code> is used to perform a series of actions utilising an object which conforms to <code><a href="Protocols/Identifier.html">Identifier</a></code>, then respond with an object conforming to <code>Codable</code> or a <code><a href="Structs/RequestError.html">RequestError</a></code> in the form of a <code><a href="Typealiases.html#/s:15KituraContracts20CodableResultClosurea">CodableResultClosure</a></code>.</p>

<p>If there has been an error you can use the <code>respondWith</code> call to respond with an appropriate error and passing nil for the <code>User?</code>. In this example, if no errors occurred and you have a <code>User</code> you can just respond with the user by passing nil as the <code>RequestError?</code> value.</p>
<h3 id='usage-example' class='heading'>Usage Example:</h3>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">User</span><span class="p">:</span> <span class="kt">Codable</span> <span class="p">{</span>
  <span class="o">...</span>
<span class="p">}</span>

<span class="k">var</span> <span class="nv">userStore</span><span class="p">:</span> <span class="p">[</span><span class="kt">Int</span><span class="p">,</span> <span class="kt">User</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="o">...</span><span class="p">)</span>

<span class="n">router</span><span class="o">.</span><span class="nf">get</span><span class="p">(</span><span class="s">"/users"</span><span class="p">)</span> <span class="p">{</span> <span class="p">(</span><span class="nv">id</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">respondWith</span><span class="p">:</span> <span class="p">(</span><span class="kt">User</span><span class="p">?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="k">in</span>
  <span class="k">guard</span> <span class="k">let</span> <span class="nv">user</span> <span class="o">=</span> <span class="k">self</span><span class="o">.</span><span class="n">userStore</span><span class="p">[</span><span class="n">id</span><span class="p">]</span> <span class="k">else</span> <span class="p">{</span>
      <span class="nf">respondWith</span><span class="p">(</span><span class="kc">nil</span><span class="p">,</span> <span class="o">.</span><span class="n">notFound</span><span class="p">)</span>
      <span class="k">return</span>
  <span class="p">}</span>
  <span class="o">...</span>
  <span class="nf">respondWith</span><span class="p">(</span><span class="n">user</span><span class="p">,</span> <span class="kc">nil</span><span class="p">)</span>
<span class="p">}</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">IdentifierSimpleCodableClosure</span><span class="o">&lt;</span><span class="kt">Id</span><span class="p">,</span> <span class="kt">O</span><span class="o">&gt;</span> <span class="o">=</span> <span class="p">(</span><span class="kt">Id</span><span class="p">,</span> <span class="kd">@escaping</span> <span class="kt"><a href="Typealiases.html#/s:15KituraContracts20CodableResultClosurea">CodableResultClosure</a></span><span class="o">&lt;</span><span class="kt">O</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">where</span> <span class="kt">Id</span> <span class="p">:</span> <span class="kt"><a href="Protocols/Identifier.html">Identifier</a></span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">O</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </section>

      </article>
    </div>
    <section class="footer">
      <p>&copy; 2020 <a class="link" href="https://github.com/Kitura/KituraContracts" target="_blank" rel="external">IBM and Kitura project authors</a>. All rights reserved. (Last updated: 2020-12-09)</p>
      <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
    </section>
  </body>
</div>
</html>
